//Funtion:To create the random number and calculate the frequency

#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;

int main()
{
	int randonNumber;
	int frequency1 = 0;
	int frequency2 = 0;
	int frequency3 = 0;
	int frequency4 = 0;
	int frequency5 = 0;
	int frequency6 = 0;
	
	for(int counter=1; counter<=6000; counter++)
	{
		randonNumber = 1 + rand() % 6;
		cout << setw(4) << randonNumber;
		if(counter % 20 == 0)
			cout << endl;
		switch(randonNumber)
		{
			case 1:
				frequency1++;
				break;
			case 2:
				frequency2++;
				break;
			case 3:
				frequency3++;
				break;	
			case 4:
				frequency4++;
				break;
			case 5:
				frequency5++;
				break;
			case 6:
				frequency6++;
				break;
			default:
				cout << "Program will not go there!" << endl;
		}
	}
	cout << "Face" << setw(12) << "Frequency"
		 << "\n 1" << setw(12) << frequency1
		 << "\n 2" << setw(12) << frequency2
		 << "\n 3" << setw(12) << frequency3
		 << "\n 4" << setw(12) << frequency4
		 << "\n 5" << setw(12) << frequency5
		 << "\n 6" << setw(12) << frequency6 << endl;
	
	return 0;	  
}
